package com.javatiaocao.myblog.controller;

import com.javatiaocao.myblog.model.BlogUser;
import com.javatiaocao.myblog.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/getid")
    public String getUserById(){
        BlogUser blogUser = userService.get(1);
        return blogUser.toString();
    }

    @GetMapping("/findBP")
    public String findBP(){
        return userService.findByPhone("18888888888").toString();
    }

}
